using System.ComponentModel;

namespace WowAceUpdater.Properties
{
    // This class allows you to handle specific events on the settings class:
    //  The SettingChanging event is raised before a setting's value is changed.
    //  The PropertyChanged event is raised after a setting's value is changed.
    //  The SettingsLoaded event is raised after the setting values are loaded.
    //  The SettingsSaving event is raised before the setting values are saved.
    internal sealed partial class Settings
    {
        #region Constructors

        #endregion

        #region Private Methods

        internal void EnableEvents()
        {
            PropertyChanged += Settings_PropertyChanged;
        }


        private static void Settings_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName.Equals("AceFilesPath") || e.PropertyName.Equals("SkipSvnWorkingCopies"))
                WowAceFilesServer.CacheDirty = true;
            else if (e.PropertyName.Equals("WowInstallDirectory"))
                WowEnvironment.WowInstallDirChanged();
        }

        #endregion
    }
}